package com.lwk.controller;

// 请求编写
import com.lwk.service.JdService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;
import java.util.Map;

@RestController
@Api(tags = "swagger测试请求")
public class JdController {

    @Autowired
    private JdService jdService;

    @GetMapping("/parseJd/{keyWord}")
    public Boolean parseJd(@PathVariable String keyWord) throws IOException {
        return jdService.parseJd(keyWord);
    }
    @ApiOperation(value = "分页结果",notes = "测试")
    @GetMapping("/searchPage/{keyword}/{pageNo}/{pageSize}")
    public List<Map<String, Object>> searchPage(@PathVariable String keyword, @PathVariable int pageNo, @PathVariable int pageSize) throws IOException {
        return jdService.searchPage(keyword,pageNo,pageSize);
    }


}
